<dl class="n-box">
	<dt class="n-box-head">
		<b>公共号列表</b>
	</dt>
	<dd class="n-box-body">
		<form method="post" action="<?=n_url('page', 'slideUpdate')?>">
		<dl class="n-form n-sep-top">
			<dt>名称：</dt>
			<dd><input type="text" name="title" value="<?=$data['slideInfo']['name']?>"></dd>
			<dt>展示图：</dt>
			<dd><input type='file' id="imgUpload">,请上传754*290像素的图片</dd>
			<dt>预览：</dt>
			<dd>
				<div id="imgShow">
				<?php if(!empty($data['slideInfo']['img_name'])):?>
					<img style="width:300px" src="/page/slide/<?=$data['slideInfo']['img_name']?>">
				<?php endif;?>
				</div>
				
			</dd>
			<dt>内容：</dt>
			<dd style="width:700px;">
				<textarea id="editor" placeholder="Balabala" autofocus name="pageDetail"><?=$data['slideInfo']['detail']?></textarea>
				
			</dd>
			<dt>&nbsp;</dt>
			<dd>
				<input type="hidden" name="sid" value="<?=$data['sid']?>">
				<button>保存</button>
			</dd>
		</dl>
		</form>
		
		<?php n_mod('simditor')->loadSimditor();?>
	</dd>
</dl>
<script type="text/javascript">
$(document).ready(function() {
	$('#imgUpload').change(function() {
		var imgExt = ['.jpg', '.gif', '.png']
		var data = new FormData()
		data.append('upload_file', $('#imgUpload')[0].files[0])
		$.ajax({
			url:'/page/slideImgUpload.html',
			type:'POST',
			data:data,
			cache:false,
			processData:false,
			contentType:false,
			processData:false,
			success:function(rs) {
				rsInfo = JSON.parse(rs)
				if (rsInfo['status']) {
					imgUrl = '/page/slide/' + rsInfo['info']
					$('#imgShow').html("<img style='width:100px' src='"+imgUrl+"'><input type='hidden' name='imgName' value='"+rsInfo['info']+"'>")
				} else {
					$('#imgShow').html(rsInfo['info'])
				}
			}
		})
	})
})
</script>